public interface Loggable {
    default void logOperation(String operation) {
        User currentUser = UserContext.getCurrentUser();
        if (currentUser != null) {
            new Log(operation, currentUser.getUsername()).saveLog();
        } else {
            new Log(operation, "系统").saveLog(); // 无登录用户时标记为系统操作
        }
    }
}
    